home *** CD-ROM | disk | FTP | other *** search
/ InterCD 2002 January / january_2002.iso / Piposh Special / Piposh / FRITZ1.DXR / 00206_foedecide2.ls < prev    next >
Encoding:
Text File  |  2004-12-06  |  5.9 KB  |  155 lines

  1. on foes2 myfoe, mycnl
  2.   global ppl, foes, mnv, pwr, psyprop, fxpath
  3.   if (getAt(foes, 1) = myfoe) and (myfoe <> 207) then
  4.     if getAt(foes, 1) = myfoe then
  5.       if the locH of sprite getAt(ppl, 1) < (the locH of sprite getAt(ppl, 2) - 120) then
  6.         set the member of sprite mycnl to member(myfoe + 1)
  7.         setAt(foes, 1, 163)
  8.         setAt(mnv, 2, 12)
  9.         sprite(getAt(ppl, 2)).flipH = 0
  10.       else
  11.         if the locH of sprite getAt(ppl, 1) > (the locH of sprite getAt(ppl, 2) + 120) then
  12.           set the member of sprite mycnl to member(myfoe + 1)
  13.           setAt(foes, 1, 163)
  14.           setAt(mnv, 2, 12)
  15.           sprite(getAt(ppl, 2)).flipH = 1
  16.         else
  17.           if abs(the locV of sprite getAt(ppl, 1) - the locV of sprite getAt(ppl, 2)) < 90 then
  18.             set the member of sprite mycnl to member(175)
  19.             setAt(foes, 1, 175)
  20.             setAt(mnv, 2, 5)
  21.             if the locH of sprite getAt(ppl, 1) > the locH of sprite getAt(ppl, 2) then
  22.               sprite(getAt(ppl, 2)).flipH = 1
  23.             else
  24.               sprite(getAt(ppl, 2)).flipH = 0
  25.             end if
  26.             if getAt(pwr, 1) > 0 then
  27.               if psyprop <> 0 then
  28.                 set the keyUpScript to "psyreg"
  29.                 set the keyDownScript to "psyregb"
  30.                 if random(3) = 1 then
  31.                   sound playFile 2, fxpath & random(3) + 286
  32.                 else
  33.                   sound playFile 1, fxpath & "ene1prp.aif"
  34.                 end if
  35.                 puppetSprite(31, 1)
  36.                 set the loc of sprite 31 to the loc of sprite getAt(ppl, 1) - 160
  37.                 set the member of sprite 31 to member("hit" & psyprop, 1)
  38.                 psyprop = 0
  39.                 go("stage2")
  40.               end if
  41.               if (the keyCode = 49) and (getAt(mnv, 1) > 1) then
  42.                 sound playFile 1, fxpath & "enefis.aif"
  43.               else
  44.                 g = random(2)
  45.                 if g = 1 then
  46.                   g = 46
  47.                 else
  48.                   g = 55
  49.                 end if
  50.                 set the member of sprite getAt(ppl, 1) to member(g, 2)
  51.                 setAt(pwr, 1, getAt(pwr, 1) - 5)
  52.                 setAt(mnv, 1, 6)
  53.                 sound playFile 1, fxpath & "ene1hit.aif"
  54.                 if random(3) = 1 then
  55.                   sound playFile 2, fxpath & random(6) + 268
  56.                 else
  57.                   if random(2) = 1 then
  58.                     sound playFile 2, fxpath & random(3) + 289
  59.                   end if
  60.                 end if
  61.               end if
  62.             else
  63.               sound playFile 1, fxpath & "ene1dead.aif"
  64.               set the member of sprite getAt(ppl, 1) to member(46, 2)
  65.               setAt(mnv, 1, 6)
  66.               setAt(mnv, 1, 9)
  67.               go("dead")
  68.             end if
  69.           else
  70.             if abs(the locV of sprite getAt(ppl, 1) - the locV of sprite getAt(ppl, 2)) > 90 then
  71.               setAt(foes, 1, 163)
  72.               setAt(mnv, 2, 12)
  73.             end if
  74.           end if
  75.         end if
  76.       end if
  77.     end if
  78.   else
  79.     if (getAt(foes, 2) = myfoe) and (myfoe <> 207) then
  80.       if the locH of sprite getAt(ppl, 1) < (the locH of sprite getAt(ppl, 3) - 120) then
  81.         set the member of sprite mycnl to member(myfoe + 1)
  82.         setAt(foes, 2, 163)
  83.         setAt(mnv, 3, 12)
  84.         sprite(getAt(ppl, 3)).flipH = 0
  85.       else
  86.         if the locH of sprite getAt(ppl, 1) > (the locH of sprite getAt(ppl, 3) + 120) then
  87.           set the member of sprite mycnl to member(myfoe + 1)
  88.           setAt(foes, 2, 163)
  89.           setAt(mnv, 3, 12)
  90.           sprite(getAt(ppl, 3)).flipH = 1
  91.         else
  92.           if abs(the locV of sprite getAt(ppl, 1) - the locV of sprite getAt(ppl, 3)) < 90 then
  93.             set the member of sprite mycnl to member(175)
  94.             setAt(foes, 2, 175)
  95.             setAt(mnv, 3, 5)
  96.             if the locH of sprite getAt(ppl, 1) > the locH of sprite getAt(ppl, 3) then
  97.               sprite(getAt(ppl, 3)).flipH = 1
  98.             else
  99.               sprite(getAt(ppl, 3)).flipH = 0
  100.             end if
  101.             if getAt(pwr, 1) > 0 then
  102.               if psyprop <> 0 then
  103.                 set the keyUpScript to "psyreg"
  104.                 set the keyDownScript to "psyregb"
  105.                 puppetSprite(31, 1)
  106.                 set the loc of sprite 31 to the loc of sprite getAt(ppl, 1) - 160
  107.                 set the member of sprite 31 to member("hit" & psyprop, 1)
  108.                 psyprop = 0
  109.                 if random(3) = 1 then
  110.                   sound playFile 2, fxpath & random(3) + 286
  111.                 else
  112.                   sound playFile 1, fxpath & "ene1prp.aif"
  113.                 end if
  114.                 go("stage2")
  115.               end if
  116.               if (the keyCode = 49) and (getAt(mnv, 1) > 1) then
  117.                 sound playFile 1, fxpath & "enefis.aif"
  118.               else
  119.                 g = random(2)
  120.                 if g = 1 then
  121.                   g = 46
  122.                 else
  123.                   g = 55
  124.                 end if
  125.                 set the member of sprite getAt(ppl, 1) to member(g, 2)
  126.                 setAt(pwr, 1, getAt(pwr, 1) - 5)
  127.                 setAt(mnv, 1, 6)
  128.                 sound playFile 1, fxpath & "ene1hit.aif"
  129.                 if random(3) = 1 then
  130.                   sound playFile 2, fxpath & random(6) + 268
  131.                 else
  132.                   if random(2) = 1 then
  133.                     sound playFile 2, fxpath & random(3) + 289
  134.                   end if
  135.                 end if
  136.               end if
  137.             else
  138.               sound playFile 1, fxpath & "ene2dead.aif"
  139.               set the member of sprite getAt(ppl, 1) to member(46, 2)
  140.               setAt(mnv, 1, 6)
  141.               setAt(mnv, 1, 9)
  142.               go("dead")
  143.             end if
  144.           else
  145.             if abs(the locV of sprite getAt(ppl, 1) - the locV of sprite getAt(ppl, 2)) > 90 then
  146.               setAt(foes, 2, 163)
  147.               setAt(mnv, 3, 12)
  148.             end if
  149.           end if
  150.         end if
  151.       end if
  152.     end if
  153.   end if
  154. end
  155.